#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
#include<assert.h>
class date {
public:
    bool operator==(const date& dt)const {
        return this->_day == dt._day && this->_month == dt._month &&
            this->_year == dt._year;



    }
    bool operator>(const  date& dt)const {
        if (_year > dt._year) {
            return true;
        }
        else if (_year == dt._year && _month > dt._month) {
            return true;
        }
        else if (_year == dt._year && _month == _month && _day > dt._day) {
            return true;
        }
        return false;
    }
    bool operator<(const date& dt)const {

        return !(*this > dt || *this == dt);


    }
    bool operator!=(const date& dt)const
    {
        return !(*this == dt);

    }
    date(int year, int month, int day)
        : _year(year)
        , _month(month)
        , _day(day) {

    }
    int getyeardays(int month, int year) {
        assert(month > 0 && month < 13);
        static int monthDayArray[13] = { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        if (month == 2 && (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
            return 29;
        }
        else {
            return monthDayArray[month];
        }



    }
    date operator++(int)
    {
        date tmp(*this);
        *this += 1;
        return tmp;

    }
    date& operator+=(int day)
    {
        /*date tmp(*this);*/
        _day += day;
        while (_day > getyeardays(_month, _year))
        {
            _day -= getyeardays(_month, _year);
            ++_month;
            if (_month == 13)
            {
                _month = 1;
                _year++;
            }


        }
        return *this;
    }
    int operator-(const date& dt) {
        date min(dt);
        date max(*this);
        if (max < min)
        {
            max = dt;
            min = *this;
        }
        int n = 0;
        while (max != min)
        {
            n++;
            min++;
        }
        return n;
    }
private:
    int _year;
    int _month;
    int _day;
};
int main() {
    int day1, month1, year1;
    int day2, month2, year2;
    scanf("%4d%2d%2d", &year1, &month1, &day1);
    scanf("%4d%2d%2d", &year2, &month2, &day2);
    date d1(day1, month1, year1);
    date d2(day2, month2, year2);
    cout << d1 - d2 << endl;
    return 0;

}